home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #2 / Amiga Plus CD - 1995 - No. 2.iso / startrek / trek73 / src / structs.h < prev    next >
C/C++ Source or Header  |  1995-04-11  |  3KB  |  128 lines

  1. /*
  2.  * TREK73: structs.h
  3.  *
  4.  * Struct Defs for TREK73
  5.  *
  6.  */
  7.  
  8.  
  9. struct phaser {
  10.     struct ship *target;    /* who we're aimed at */
  11.     int bearing;        /* direction aimed (if no target) */
  12.     char load;        /* energy in phasers */
  13.     char status;        /* Damaged, etc. */
  14.     int drain;        /* Drain from engines (to if negative) */
  15. } ;
  16.  
  17. struct tube {
  18.     struct ship *target;    /* who we're aimed at */
  19.     int bearing;        /* direction aimed (if no target) */
  20.     char load;        /* energy in tubes */
  21.     char status;        /* Damaged, etc */
  22. } ;
  23.  
  24. struct shield {
  25.     float eff;        /* efficiency from 0-1 */
  26.     float drain;        /* Actual drain from engines */
  27.     float attemp_drain;    /* Attempted drain from engines */
  28. } ;
  29.  
  30. struct ship {
  31.     char name[30];        /* name of ship */
  32.     char nat;        /* nationality */
  33.     int x, y;        /* location */
  34.     float warp;        /* warp speed */
  35.     float newwarp;        /* for speed changes */
  36.     int course;        /* 0-360 */
  37.     int newcourse;        /* for course changes */
  38.     struct ship *target;    /* who we're pursuing */
  39.     int eluding;        /* Flag for eluding */
  40.     struct phaser phasers[4]; /* phaser banks */
  41.     int p_spread;        /* phaser spread */
  42.     int p_percent;        /* phaser firing percentage */
  43.     struct tube tubes[6];    /* torpedo tubes */
  44.     int t_prox;        /* proximity delay */
  45.     int t_delay;        /* time delay */
  46.     int t_lspeed;        /* launch speed */
  47.     struct shield shields[4]; /* shields */
  48.     float eff;        /* efficiency */
  49.     float regen;        /* regeneration (energy per turn) */
  50.     int energy;        /* amount of effective energy */
  51.     int pods;        /* max energy level */
  52.     int crew;        /* crew left alive */
  53.     int status;        /* computer, probe l, warp, sensors, eng */
  54.     int delay;        /* how long 'till we blow up? */
  55.     int id;            /* Unique identifier */
  56.     int (*strategy)();    /* Which strategy to use */
  57. } ;
  58.  
  59. /*
  60.  * note that probes act like torpedos
  61.  * but have targets; torps only have
  62.  * courses
  63.  */
  64. struct torpedo {
  65.     struct ship *from;    /* pointer to ship they're from */
  66.     int x, y;        /* coords of object */
  67.     int course;        /* where it's going */
  68.     float speed;        /* how fast we're moving */
  69.     float newspeed;        /* what our target speed is */
  70.     struct ship *target;    /* who we're aimed at */
  71.     int fuel;        /* how many antimatter pods it has */
  72.     int timedelay;        /* time clicks left before detonation */
  73.     int prox;        /* proximity fuse */
  74.     int id;            /* Unique identifier */
  75. } ;
  76.  
  77. /*
  78.  * the list of what's in space -- depending on the type, we use
  79.  * differing parts of the union (data) structure.  it's a linked
  80.  * list of all the stuff in space.
  81.  */
  82. struct list {
  83.     int type;
  84.     struct list *back, *fwd;
  85.     union {
  86.         struct torpedo *tp;
  87.         struct ship *sp;
  88.     } data;
  89. } ;
  90.  
  91. struct cmd {
  92.     int (*routine)();
  93.     char *word1;
  94.     char *word2;
  95.     int turns;
  96. } ;
  97.  
  98. /*
  99.  * for the phaser and anti-matter damage lists
  100.  */
  101.  
  102. struct dam {
  103.     int roll;
  104.     char *mesg;
  105. };
  106.  
  107. struct damage {
  108.     float eff;
  109.     float fuel;
  110.     float regen;
  111.     float shield;
  112.     float crew;
  113.     float weapon;
  114.     struct dam stats[4];
  115. };
  116.  
  117. struct score {
  118.     int score;
  119.     int ships;
  120.     char captain[30];
  121.     char username[10];
  122. }; 
  123.  
  124. struct rates {
  125.     char *rate;
  126.     int points;
  127. };
  128.